<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8"%>
<%@ page import="util.*" %>
<%@ include file="../common/include/header.jsp"%>
<%-- 해당 커뮤니티 메인 페이지 --%>
<div width="980px">
<table border="0" cellpadding="0" cellspacing="0" width="980px">
	<tr>
		<td style="vertical-align: top;width: 180px;background-color: #fdb73a;">
			<%@ include file="../common/include/leftmenu.jsp"%>
			
		</td>
		<td style="width: 800px;vertical-align: top;">
<div style="vertical-align: top;">
			<table style="width: 800px;" cellpadding="0" cellspacing="0">
				<tr>
					<td colspan="3" style="width: 800px;height: 100px;">
						<%-- 커뮤니티 로고가 있다면 로고를 띄워준다 --%>
						<logic:notEmpty name="communityForm" property="cologosfn">
							<img src="<%=path%>/uploadfiles/<bean:write name="communityForm" property="cologosfn"/>" border="0" class="commLogo"/>
						</logic:notEmpty>
						<%-- 커뮤니티 로고가 없다면 기본적인 이미지를 띄워준다 --%>
						<logic:empty name="communityForm" property="cologosfn">
							<img src="<%=imagePath%>communitybanner.jpg" border="0" class="commLogo"/>
						</logic:empty>
					</td></tr>
					
				<tr><td style="width: 800px; text-align: center;">				
				<table style="width: 700px;border: 1px dotted #fdb73a;" cellpadding="0" cellspacing="0">
					<tr><td style="vertical-align: top; padding: 10px;">
						<%-- 팝업이 있다면 팝업을 띄워준다 --%>
						<logic:notEmpty name="communityForm" property="copoptext">
							<script type="text/javascript">
								window.attachEvent("onload",openPop());
								function openPop(){
									var poptext = '<bean:write name="communityForm" property="copoptext"/>';
									var popwidth = <bean:write name="communityForm" property="copopwidth"/>;
									var popheight = <bean:write name="communityForm" property="copopheight"/>;
									var stats = "width="+popwidth+",height="+popheight+",history=no,resizable=no,status=no,scrollbars=yes,menubar=no";
									
									pop = window.open("about:blank", "pop", stats);
									var newHTML = poptext;
									pop.document.write(newHTML);
								}
							</script>
						</logic:notEmpty>
						<div style="background:  #fdb73a;padding: 10px;border: 1px solid #e0940b;">
							<span style="font-size: x-large;font-family: 돋움체;font-weight: bold;">
							[<bean:write name="communityForm" property="coname"/>]</span>
							<span style="color: #ffffff;">(회원수 : <bean:write name="communityForm" property="count"/>명)</span>
						</div>
						<div style="width: 300px;float: left;"><img src="<%=imagePath %>comm_11.jpg" border="0"/></div>
						<div style="width: 370px;float: left;padding:5px;">
							<div style="border: 1px dotted #dddddd;padding: 5px;">

								개설자 : <span><bean:write name="communityForm" property="mid"/> ( <bean:write name="communityForm" property="mcnick"/> ) </span><br/>
								개설일 : <span id="regdate"><bean:write name="communityForm" property="coregdate"/>일</span>
								<hr/>
									<script type="text/javascript">
										window.attachEvent("onload",setRegdate);
										
										function setRegdate(){
											var regDate = document.getElementById('regdate').firstChild;
											regDate.nodeValue = regDate.nodeValue.replace(/\-/,"년 ");
											regDate.nodeValue = regDate.nodeValue.replace(/\-/,"월 ");
										}
									</script>
							<div style="height: 120px;border: 1px dotted #eeeeee;padding: 5px;background: #fffeee;text-align: left;">
								<table style="width: 350px;height: 120px;table-layout: fixed;" cellpadding="0" cellspacing="0"><tr><td style="vertical-align:top;word-break:break-all;">
									<bean:write name="communityForm" property="coguide"/>
								</td></tr></table>
								</div>
							</div>
						</div>
						</td>	</tr>
						</table>
					</td></tr>
					
				<tr><td style="text-align: left;padding-top: 10px; padding-left: 50px;">
					<table style="width: 700px;height: 150px;background: url('<%=imagePath %>comm_notice.jpg');" cellpadding="0" cellspacing="0">
						<tr><td style="width: 600px;vertical-align: top;">						
						<table style="width: 500px;border-bottom: 1px solid #fdb73a;text-align: center;">	
							<tr><td height="20" colspan="2"><td></td>
							<tr style="background: #fdb73a; "><td style="width: 100px;height: 20px;">날&nbsp;&nbsp;짜</td>
								<td style="width: 400px;">내&nbsp;&nbsp;&nbsp;&nbsp;용</td></tr>
							<%-- 커뮤니티 공지사항 중 최신 글을 보여준다 --%>
							<logic:notEmpty name="communityForm" property="noticeBoards">
								<logic:iterate id="nb" name="communityForm" property="noticeBoards" type="model.NoticeBoard">
									<tr>
										<td style="height: 20px;"><bean:write name="nb" property="nbdate" /></td>
										<td style="text-align: left;"><a href="<%=path%>/board/noticeboard.do?method=detailView&nbno=<bean:write name="nb" property="nbno"/>&cono=<bean:write name="communityForm" property="cono"/>"><bean:write name="nb" property="nbtitle"/></td>
									</tr>
								</logic:iterate>
							</logic:notEmpty>
						</table>
					</td>
					<td></td><tr>
					</table>
					</td>

				</tr>
			</table>
			
			</div>
		</td>
	</tr>
</table>
</div>
<bean:write name="membercommunity" property="lvno" scope="session"/>
<script type="text/javascript">
<!--
	<%-- 게시판 클릭했을때 발생하는 메소드 --%>
	function getBoard(u,b){
		var lvno = parseInt(<bean:write name="membercommunity" property="lvno" scope="session"/>);
		var userlv = parseInt(<bean:write name="user" property="userInfo.lvno" scope="session"/>);
		var url = '<%=path%>/board/'+u;
		url = url + escape(encodeURIComponent(b));
		if(lvno==0 && userlv<8 ){
			alert('커뮤니티 회원만 이용가능합니다.');
			return;
		}else{
			location.href=url; 
		}		
	}
	
	function check(){
		<%	boolean check = user.isLogon();
			if(check){	%>
				return true;
		<%	}else{	%>
				alert("로그인 후 이용가능 합니다.");
				return false;
		<%	}	%>
	}
	
//-->
</script>
<%@ include file="../common/include/footer.jsp" %>
